#include "tile.h"

Tile::Tile(QString newFloorType, EnvObject *newObject, Item *newItem, QList<PivotDoor*> *newPivotDoors, bool newWallB, bool newWallR) :
    floorType(newFloorType),
    object(newObject),
    item(newItem),
    pivotDoors(newPivotDoors),
    wallB(newWallB),
    wallR(newWallR) {}

Tile::~Tile() {
    delete object;
    delete item;

    while(!pivotDoors->isEmpty()) delete pivotDoors->takeFirst();
    delete pivotDoors;
}

QString Tile::getFloorType() { return floorType; }
EnvObject* Tile::getObject() { return object; }
Item* Tile::getItem() { return item; }
QList<PivotDoor*>* Tile::getPivotDoors() { return pivotDoors; }
bool Tile::getWallB() { return wallB; }
bool Tile::getWallR() { return wallR; }
void Tile::setFloorType(QString newFloorType) { floorType = newFloorType; }
void Tile::setObject(EnvObject *newObject) { object = newObject; }
void Tile::setItem(Item *newItem) { item = newItem; }
void Tile::setWallB(bool newWallB) { wallB = newWallB; }
void Tile::setWallR(bool newWallR) { wallR = newWallR; }
void Tile::toggleWallB() { wallB = !wallB; }
void Tile::toggleWallR() { wallR = !wallR; }
